﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZLDC.Common.Estate;
using System.Data;
using System.Web;
using System.Web.UI.WebControls;
namespace ZLDC.Topo.BLL.Estate
{
    public class lp_AdminUrl
    {
        public static void btnAddUpdate(string userid,System.Web.UI.Page p,string deptid)
        {
            string[] TypeName = p.Request.Form["txtTypeName"].Split(',');
            string[] URL = p.Request.Form["txtUrl"].Split(',');
            string[] Remark = p.Request.Form["txtRemark"].Split(',');
            string sql = "delete from lp_WorkUrl where UserID="+userid+";";
            DateTime time = DateTime.Now;
            for (int i = 0; i < TypeName.Length; i++)
            {
                if (TypeName[i] != "")
                {
                    sql += " insert into lp_WorkUrl (TypeName,URL,Remark,CreateTime,userid,Deptid,UserName)values('"+TypeName[i]+"','"+URL[i]+"','"+Remark[i]+"','"+time+"',"+userid+","+deptid+",'"+_Utility.GetInfoBySession().m_sUserName+"');";
                }
            }
            ZLDC.Topo.BLL.Estate.lp_Basis.Execution_sql(sql);
            p.Response.Write(ZLDC.Topo.BLL.Estate.lp_Basis.GetPageLocation());
        }
    }
}
